home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / sr / info.lha / info-sr.1992 / 000014_timbomb@cs.uq.oz.au _Thu Oct 8 14:43:46 1992.msg < prev    next >
Text File  |  1993-07-24  |  2KB  |  83 lines

  1. Received: from uqcspe.cs.uq.oz.au ([130.102.192.8]) by optima.cs.arizona.edu (5.65c/15) via SMTP
  2.     id AA10159; Wed, 7 Oct 1992 21:43:14 MST
  3. Received: from weevil.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  4.     id <AA06080@uqcspe.cs.uq.oz.au>; Thu, 8 Oct 92 14:43:10 +1000
  5. Message-Id: <9210080443.AA06080@uqcspe.cs.uq.oz.au>
  6. To: info-sr@cs.arizona.edu
  7. Subject: Possibly dumb crash question...
  8. Date: Thu, 08 Oct 92 14:43:46 +1000
  9. From: Tim Mansfield <timbomb@cs.uq.oz.au>
  10.  
  11.  
  12. The SR that follows is two resources called eftpos2 and main.
  13. Main is just there to call initiate() on eftpos2 to test the resource.
  14. The problem is that the resource crashes with a Memory Fault at the last line 
  15. in bank() ("send pget(5)").
  16.  
  17. The code makes sense to me. Does anyone have any ideas why it should crash?
  18. We're running SRv2.
  19.  
  20. tim
  21.  
  22. -------
  23.  
  24. resource eftpos2
  25.   op initiate()
  26.   optype get(i: int)
  27.   optype put(i: int; pget: cap get)
  28.   op pos(cput: cap put) returns q: cap get
  29.   op bank() returns p: cap put
  30.  
  31. body eftpos2()
  32.   proc initiate()
  33.     var pc: cap get
  34.     var bc: cap put
  35.  
  36.     bc:= bank()
  37.     pc:= pos(bc)
  38.   end
  39.  
  40.   proc bank() returns p
  41.     op bankput: put
  42.     var pget: cap get
  43.  
  44.     p:= bankput
  45.     reply
  46.     in bankput(banktest, pget) ->
  47.       write("banktest", banktest)
  48.     ni
  49.     send pget(5)    # memory fault here
  50.   end
  51.  
  52.   proc pos(bankput) returns q
  53.     op posget: get
  54.  
  55.     q:= posget
  56.     reply
  57.     send bankput(5, posget)
  58.     in posget(postest) ->
  59.       write("postest", postest)
  60.     ni
  61.   end
  62.  
  63. end eftpos2
  64.  
  65.  
  66.  
  67. resource main
  68.   import eftpos2
  69.  
  70. body main()
  71.   
  72.   process maintest
  73.     var ec: cap eftpos2
  74.     var key: int
  75.  
  76.     write("type a number to continue....")
  77.     read(key)
  78.     ec := create eftpos2()
  79.     ec.initiate()
  80.   end
  81.  
  82. end main
  83.